/*
 * @Description: 客户应用管理接口
 * @Author: chendingfengmail@163.com
 * @Date: 2021-11-05 18:07:25
 * @LastEditTime: 2022-01-10 15:42:11
 * @LastEditors: chendingfengmail@163.com
 * @Reference: 
 */
import { request } from "../service";

const clientApp = {
  //添加客户应用信息
  add(param) {
    return request({
      url: "/auth/clientApp/add",
      method: "post",
      data: addDefaultParam(param),
    })
  },

  //删除客户应用信息
  del(id) {
    return request({
      url: `/auth/clientApp/delete/${id}`,
      method: 'delete',
    })
  },

  //查找客户应用信息列表
  findList(param) {
    return request({
      url: '/auth/clientApp/list',
      method: 'get',
      params: param,
    })
  },

  //通过主键查找客户应用信息
  findById(id) {
    return request({
      url: `/auth/clientApp/findById/${id}`,
      method: 'get',
    })
  },

  //通过属性查找客户应用信息总数
  findMax(param) {
    return request({
      url: '/auth/clientApp/count',
      method: 'get',
      params: param,
    })
  },

  //更新客户应用信息
  update(param) {
    return request({
      url: '/auth/clientApp/update',
      method: 'put',
      data: addDefaultParam(param),
    })
  },

}

/**
 * 添加缺省参数值
 * @param {*} param 原始参数
 * @returns 携带缺省参数返回
 */
function addDefaultParam(param) {
  let params = param;
  //params['app'] = process.env.VUE_APP_SYSTEM_NAME;
  return params;
}

export default clientApp;
